package com.wish.renting.controller;

import com.wish.base.entity.MOwner;
import com.wish.base.service.IMOwnerService;
import com.wish.common.core.web.controller.BaseController;
import com.wish.common.core.web.page.TableDataInfo;
import com.wish.common.security.annotation.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/*

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)

*/
@RestController
@RequestMapping("/owner")
public class TMOwnerController extends BaseController {

    @Autowired
    private IMOwnerService imOwnerService;

    /**
     * 查询列表
     */
    @PreAuthorize(hasPermi = "renting:owner:list1")
    @GetMapping("/list")
    public TableDataInfo list(MOwner tMOwner) {
        startPage();
        List<MOwner> list = imOwnerService.list();
        return getDataTable(list);
    }




    /*   *//**
 * 导出【请填写功能名称】列表
 *//*
    @PreAuthorize(hasPermi = "system:owner:export")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TMOwner tMOwner) throws IOException
    {
        List<TMOwner> list = tMOwnerService.selectTMOwnerList(tMOwner);
        ExcelUtil<TMOwner> util = new ExcelUtil<TMOwner>(TMOwner.class);
        util.exportExcel(response, list, "owner");
    }

    *//**
 * 获取【请填写功能名称】详细信息
 *//*
    @PreAuthorize(hasPermi = "system:owner:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(tMOwnerService.selectTMOwnerById(id));
    }

    *//**
 * 新增【请填写功能名称】
 *//*
    @PreAuthorize(hasPermi = "system:owner:add")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TMOwner tMOwner)
    {
        return toAjax(tMOwnerService.insertTMOwner(tMOwner));
    }

    *//**
 * 修改【请填写功能名称】
 *//*
    @PreAuthorize(hasPermi = "system:owner:edit")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TMOwner tMOwner)
    {
        return toAjax(tMOwnerService.updateTMOwner(tMOwner));
    }

    *//**
 * 删除【请填写功能名称】
 *//*
    @PreAuthorize(hasPermi = "system:owner:remove")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tMOwnerService.deleteTMOwnerByIds(ids));
    }*/
}

